﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KDSugar.Galaxy.API.Except
{
    /// <summary>
    /// 执行异常类
    /// </summary>
    public class ExecuteException : Exception
    {
        /// <summary>
        /// 追加报错信息
        /// </summary>
        public string AppendMessage { get; set; }

        /// <summary>
        /// 执行调用与返回数据信息
        /// </summary>
        public ExecuteDataInfo ExecuteData { get; set; }

        /// <summary>
        /// 操作指令名称
        /// </summary>
        public string OperateCommandName { get; set; }

        /// <summary>
        /// 执行异常初始化
        /// </summary>
        public ExecuteException()
            : base()
        {

        }

        /// <summary>
        /// 执行异常初始化
        /// </summary>
        /// <param name="_appendMsg">追加报错信息</param>
        /// <param name="_dataInfo">执行调用与返回数据信息</param>
        public ExecuteException(string _appendMsg,ExecuteDataInfo _dataInfo)
            : this()
        {
            AppendMessage = _appendMsg;
            ExecuteData = _dataInfo;
        }

        /// <summary>
        /// 执行异常初始化
        /// </summary>
        /// <param name="_appendMsg">追加报错信息</param>
        public ExecuteException(string _appendMsg)
            : this(_appendMsg, null)
        {

        }

        /// <summary>
        /// 执行异常初始化
        /// </summary>
        /// <param name="_dataInfo">执行调用与返回数据信息</param>
        public ExecuteException(ExecuteDataInfo _dataInfo)
            : this(null, _dataInfo)
        {

        }
    }
}
